Skip to content

Add EntityCountDiagnosticPlugin#262

Merged
waynemwashuma merged 1 commit intowimaengine:devfrom
waynemwashuma:add-entity-count-diagnostics
Sep 20, 2025
Merged

Add EntityCountDiagnosticPlugin#262
waynemwashuma merged 1 commit intowimaengine:devfrom
waynemwashuma:add-entity-count-diagnostics

Conversation

@waynemwashuma
Copy link
Collaborator

@waynemwashuma waynemwashuma commented Sep 20, 2025

Objective

Adds a new EntityCountDiagnosticPlugin to the diagnostics module. The plugin provides a simple on-screen display of the current entity count, helping developers quickly monitor ECS entity usage during runtime.This diagnostic tool is particularly useful for:

  • Identifying entity leaks (continuously increasing count)
  • Performance optimization (monitoring entity population)
  • Debugging spawn/despawn systems
  • Understanding scene complexity in real-time

Solution

Implemented EntityCountDiagnosticPlugin, which sets up ​​​​a small black box in the top-right corner of the screen, showing the number of entities.

Showcase

Enabling the plugin in an app:

import { App, EntityCountDiagnosticPlugin } from 'wima'

const app = new App()
app.registerPlugin(new EntityCountDiagnosticPlugin())
   .run()

Migration guide

No breaking changes. The plugin is optional.

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma waynemwashuma self-assigned this Sep 20, 2025
@waynemwashuma waynemwashuma marked this pull request as ready for review September 20, 2025 21:45
@waynemwashuma waynemwashuma merged commit 62fc6fd into wimaengine:dev Sep 20, 2025
5 checks passed
@waynemwashuma waynemwashuma deleted the add-entity-count-diagnostics branch September 20, 2025 22:08
@waynemwashuma waynemwashuma added type:enhancement New feature or request mod:diagnostic This issue/PR affects the diagnostic module labels Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:diagnostic This issue/PR affects the diagnostic module type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant